<?php
/* SVN FILE: $Id: app_controller.php 137 2009-08-19 10:26:08Z miha@nahtigal.com $ */
/**
 * Short description for app_controller.php
 *
 * Long description for app_controller.php
 *
 * PHP versions 4 and 5
 *
 * Copyright (c) 2009, Miha Nahtigal
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright     Copyright (c) 2009, Miha Nahtigal
 * @link          http://www.nahtigal.com/
 * @package       lil_blogs_app
 * @subpackage    lil_blogs_app
 * @since         v 1.0
 * @version       $Revision: 137 $
 * @modifiedby    $LastChangedBy: miha@nahtigal.com $
 * @lastmodified  $Date: 2009-08-19 10:26:08 +0000 (Wed, 19 Aug 2009) $
 * @license       http://www.opensource.org/licenses/mit-license.php The MIT License
 */
/**
 * AppController class
 *
 * @uses          Controller
 * @package       lil_blogs_app
 * @subpackage    lil_blogs_app
 */
class AppController extends Controller {
/**
 * components property
 *
 * @var bool
 * @access public
 */
	var $components = array('Auth');
/**
 * beforeFilter method
 *
 * @access public
 * @return void
 */
	function beforeFilter() {
		parent::beforeFilter();
		
		$this->Auth->loginRedirect	= '/admin';
		$this->Auth->logoutRedirect	= '/';
		$this->Auth->loginAction	= '/login';
		$this->Auth->userModel		= 'Author';
		$this->Auth->fields			= array('username' => 'username', 'password' => 'passwd');
		$this->Auth->authorize		= 'controller';
		$this->Auth->sessionKey		= 'Auth.Author';
		$this->Auth->loginError		= __('Wrong username or password. Please try again.', true);
		$this->Auth->authError		= __('User must be logged in.', true);
		
		$this->set('Auth', $this->Auth->user());
	}
}
?>
